Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@builder.io/sdk

Package Overview
Dependencies
Maintainers
1
Versions
696
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@builder.io/sdk - npm Package Compare versions

Comparing version 0.0.16 to 0.0.17

3

index.d.ts

@@ -0,1 +1,2 @@

import { Observable } from 'rxjs/Observable';
import { Observer } from 'rxjs/Observer';

@@ -39,4 +40,4 @@ export interface ParamsMap {

getUserAttributes(userAgent?: string): UserAttributes;
getContent(modelName: string, options?: GetContentOptions): any;
getContent(modelName: string, options?: GetContentOptions): Observable<any[]>;
}
export declare const builder: Builder;

@@ -1,7 +0,9 @@

import { sortBy } from 'lodash';
import * as queryString from 'query-string';
import * as parser from 'ua-parser-js';
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var lodash_1 = require("lodash");
var queryString = require("query-string");
var parser = require("ua-parser-js");
// import { ContentModelType } from '../../app/models/content.model';
import { Observable } from 'rxjs/Observable';
import stringify from 'json-stable-stringify';
var Observable_1 = require("rxjs/Observable");
var json_stable_stringify_1 = require("json-stable-stringify");
var anyParser = parser;

@@ -16,3 +18,3 @@ // Workaround for oddly random module loading issues

var contentData = data.data.data; // hmmm...
var observer = builder.observersByModelType[model];
var observer = exports.builder.observersByModelType[model];
if (observer) {

@@ -57,3 +59,3 @@ observer.next([contentData]);

// TODO: merge in the attribute from query string ones
queryParams.userAttributes = stringify(this.getUserAttributes());
queryParams.userAttributes = json_stable_stringify_1.default(this.getUserAttributes());
// TODO: cachebust if bd.noCache in request, also perhaps if in iframe

@@ -73,3 +75,3 @@ if (options.cachebust) {

var host = options.dev ? 'http://localhost:5000' : 'https://builder.io';
return new Observable(function (observer) {
return new Observable_1.Observable(function (observer) {
// TODO: will there by use cases of multiple separate requests for same model type?

@@ -80,3 +82,3 @@ _this.observersByModelType[modelName] = observer;

.then(function (res) { return res.json(); })
.then(function (list) { return sortBy(list, function (item) { return item.priority; }); })
.then(function (list) { return lodash_1.sortBy(list, function (item) { return item.priority; }); })
.then(function (result) {

@@ -92,6 +94,6 @@ observer.next(result);

}());
export { Builder };
export var builder = new Builder();
exports.Builder = Builder;
exports.builder = new Builder();
// FIXME: remove
// TODO: UMD with window
window.builder = builder;
window.builder = exports.builder;
{
"name": "@builder.io/sdk",
"version": "0.0.16",
"version": "0.0.17",
"main": "./index.js",

@@ -5,0 +5,0 @@ "types": "./index.d.ts",

{
"compilerOptions": {
"target": "es5",
"module": "es6",
"module": "commonjs",
"strict": true,
"declaration": true,
"lib": ["dom", "es6"],
"typeRoots": ["@types./node_modules/@types"],
"typeRoots": ["./node_modules/@types"],
"allowSyntheticDefaultImports": true

@@ -10,0 +10,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc