How to use the odata.id function in odata

To help you get started, we’ve selected a few odata examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pnp / pnpjs / test / main.ts View on Github external
const web = Web(e["odata.id"], "");

        console.log(`Deleting: ${e["odata.id"]}`);

        const children = await web.webs.select("Title")();

        await Promise.all(children.map(async (value) => {
            const web2 = Web(value["odata.id"], "");
            console.log(`Deleting: ${value["odata.id"]}`);
            return web2.delete();
        }));

        await web.delete();

        console.log(`Deleted: ${e["odata.id"]}`);
    });
}
github pnp / pnpjs / test / main.ts View on Github external
await Promise.all(children.map((value) => {
            const web2 = Web(value["odata.id"], "");
            console.log(`Deleting: ${value["odata.id"]}`);
            return web2.delete();
        }));
github pnp / pnpjs / test / main.ts View on Github external
await Promise.all(children.map(async (value) => {
            const web2 = Web(value["odata.id"], "");
            console.log(`Deleting: ${value["odata.id"]}`);
            return web2.delete();
        }));
github pnp / pnpjs / test / main.ts View on Github external
w.forEach(async (e: any) => {

        const web = Web(e["odata.id"], "");

        console.log(`Deleting: ${e["odata.id"]}`);

        const children = await web.webs.select("Title")();

        await Promise.all(children.map(async (value) => {
            const web2 = Web(value["odata.id"], "");
            console.log(`Deleting: ${value["odata.id"]}`);
            return web2.delete();
        }));

        await web.delete();

        console.log(`Deleted: ${e["odata.id"]}`);
    });
}
github pnp / pnpjs / test / main.ts View on Github external
return Promise.all(sw.map((value) => {
                    const web2 = new Web(value["odata.id"], "");
                    return web2.delete();
                }));
            }).then(() => { web.delete(); });
github pnp / pnpjs / test / main.ts View on Github external
w.forEach((element: any) => {
            const web = new Web(element["odata.id"], "");
            web.webs.select("Title").get().then((sw: any[]) => {
                return Promise.all(sw.map((value) => {
                    const web2 = new Web(value["odata.id"], "");
                    return web2.delete();
                }));
            }).then(() => { web.delete(); });
        });
    });
github SharePoint / PnP-JS-Core / src / sharepoint / rest / odata.ts View on Github external
export function extractOdataId(candidate: any): string {

    if (candidate.hasOwnProperty("odata.id")) {
        return candidate["odata.id"];
    } else if (candidate.hasOwnProperty("__metadata") && candidate.__metadata.hasOwnProperty("id")) {
        return candidate.__metadata.id;
    } else {
        Logger.log({
            data: candidate,
            level: LogLevel.Error,
            message: "Could not extract odata id in object, you may be using nometadata. Object data logged to logger.",
        });
        throw new Error("Could not extract odata id in object, you may be using nometadata. Object data logged to logger.");
    }
}
github SharePoint / PnP-JS-Core / dist / pnp-provisioning.js View on Github external
function extractOdataId(candidate) {
    if (candidate.hasOwnProperty("odata.id")) {
        return candidate["odata.id"];
    }
    else if (candidate.hasOwnProperty("__metadata") && candidate.__metadata.hasOwnProperty("id")) {
        return candidate.__metadata.id;
    }
    else {
        logging_1.Logger.log({
            data: candidate,
            level: logging_1.LogLevel.Error,
            message: "Could not extract odata id in object, you may be using nometadata. Object data logged to logger.",
        });
        throw new Error("Could not extract odata id in object, you may be using nometadata. Object data logged to logger.");
    }
}
exports.extractOdataId = extractOdataId;
github pnp / pnpjs / packages / sp / src / site.ts View on Github external
return this.clone(Site, `openWebById('${webId}')`).postCore().then(d => ({
            data: d,
            web: Web.fromUrl(d["odata.id"] || d.__metadata.uri),
        }));
    }
github pnp / pnpjs / sp / src / site.ts View on Github external
return this.clone(Site, `openWebById('${webId}')`).postCore().then(d => ({
            data: d,
            web: Web.fromUrl(d["odata.id"] || d.__metadata.uri),
        }));
    }

odata

o.js is a isomorphic Odata Javascript library to simplify the request of data. The main goal is to build a standalone, lightweight and easy to understand Odata lib.

MIT
Latest version published 3 months ago

Package Health Score

76 / 100
Full package analysis